package com.eling.elcms.basedoc.service.impl;

import com.eling.elcms.basedoc.dao.IComOrgRelationDao;
import com.eling.elcms.basedoc.model.ComOrgRelation;
import com.eling.elcms.basedoc.service.IComOrgRelationManager;
import com.eling.elcms.core.service.impl.GenericManagerImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ComOrgRelationManagerImpl extends GenericManagerImpl<ComOrgRelation,Long> implements IComOrgRelationManager{

	IComOrgRelationDao comOrgRelationDao;
	
	@Autowired
	public void setDao(IComOrgRelationDao dao) {
        this.dao = dao;
        this.comOrgRelationDao = dao;
    }

	@Override
	public List<ComOrgRelation> queryCom(ComOrgRelation cond) {
		if(cond.getOrganization().getPkOrganization() == 1L){
			cond.setOrganization(null);
		}
		return comOrgRelationDao.queryCom(cond);
	}
}
